home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / usr / share / gtksourceview-2.0 / language-specs / nemerle.lang < prev    next >
Extensible Markup Language  |  2009-10-02  |  8KB  |  262 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3.  
  4.  Author: Pawe┼é W. Olszta <pawel.olszta@nemerle.org>
  5.  Copyright (C) 2004 Pawe┼é W. Olszta <pawel.olszta@nemerle.org>
  6.  
  7.  This library is free software; you can redistribute it and/or modify
  8.  it under the terms of the GNU General Public License as published by
  9.  the Free Software Foundation; either version 2 of the License, or
  10.  (at your option) any later version.
  11.  
  12.  This program is distributed in the hope that it will be useful,
  13.  but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.  GNU General Public License for more details.
  16.  
  17.  You should have received a copy of the GNU General Public License
  18.  along with this program; if not, write to the Free Software
  19.  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  20.  
  21. -->
  22. <language id="nemerle" _name="Nemerle" version="2.0" _section="Sources">
  23.   <metadata>
  24.     <property name="mimetypes">text/x-nemerle</property>
  25.     <property name="globs">*.n</property>
  26.     <property name="line-comment-start">//</property>
  27.     <property name="block-comment-start">/*</property>
  28.     <property name="block-comment-end">*/</property>
  29.   </metadata>
  30.  
  31.   <styles>
  32.     <style id="comment" _name="Comment" map-to="def:comment"/>
  33.     <style id="error" _name="Error" map-to="def:error"/>
  34.     <style id="preprocessor" _name="Preprocessor" map-to="def:preprocessor"/>
  35.     <style id="character" _name="Character" map-to="def:character"/>
  36.     <style id="string" _name="String" map-to="def:string"/>
  37.     <style id="keyword" _name="Keyword" map-to="def:keyword"/>
  38.     <style id="type" _name="Data Type" map-to="def:type"/>
  39.     <style id="null-value" _name="Null Value" map-to="def:special-constant"/>
  40.     <style id="boolean" _name="Boolean value" map-to="def:boolean"/>
  41.     <style id="floating-point" _name="Floating point number" map-to="def:floating-point"/>
  42.     <style id="decimal" _name="Decimal number" map-to="def:decimal"/>
  43.     <style id="binary" _name="Binary number" map-to="def:base-n-integer"/>
  44.     <style id="octal" _name="Octal number" map-to="def:base-n-integer"/>
  45.     <style id="hexadecimal" _name="Hexadecimal number" map-to="def:base-n-integer"/>
  46.   </styles>
  47.  
  48.   <definitions>
  49.  
  50.     <context id="line-comment" style-ref="comment" end-at-line-end="true">
  51.       <start>//</start>
  52.       <include>
  53.         <context ref="def:in-line-comment"/>
  54.       </include>
  55.     </context>
  56.  
  57.     <context id="block-comment" style-ref="comment">
  58.       <start>/\*</start>
  59.       <end>\*/</end>
  60.       <include>
  61.         <context ref="def:in-comment"/>
  62.       </include>
  63.     </context>
  64.  
  65.     <context id="close-comment-outside-comment" style-ref="error">
  66.       <match>\*/(?!\*)</match>
  67.     </context>
  68.  
  69.     <define-regex id="preproc-start">^\s*#\s*</define-regex>
  70.  
  71.     <context id="if-false-comment" style-ref="comment">
  72.       <start>\%{preproc-start}if\s*false\b</start>
  73.       <end>\%{preproc-start}(endif|else|elif)\b</end>
  74.       <include>
  75.         <context id="if-in-if-false">
  76.           <start>\%{preproc-start}if(n?def)?\b</start>
  77.           <end>\%{preproc-start}endif\b</end>
  78.           <include>
  79.             <context ref="if-in-if-false"/>
  80.             <context ref="def:in-comment"/>
  81.           </include>
  82.         </context>
  83.         <context ref="def:in-comment"/>
  84.       </include>
  85.     </context>
  86.  
  87.     <context id="preprocessor" style-ref="preprocessor" end-at-line-end="true">
  88.       <start extended="true">
  89.         \%{preproc-start}
  90.         (define|undef|if(n?def)?|else|elif|endif|line|error|warning|region|endregion)
  91.         \b
  92.       </start>
  93.       <include>
  94.         <context ref="line-comment"/>
  95.         <context ref="block-comment"/>
  96.       </include>
  97.     </context>
  98.  
  99.     <context id="character" style-ref="character">
  100.       <match>'(\\)?.'</match>
  101.     </context>
  102.  
  103.     <context id="string" style-ref="string" end-at-line-end="true">
  104.       <start>'</start>
  105.       <end>'</end>
  106.       <include>
  107.         <context ref="def:escape"/>
  108.         <context ref="def:line-continue"/>
  109.       </include>
  110.     </context>
  111.  
  112.     <context id="keywords" style-ref="keyword">
  113.       <keyword>_</keyword>
  114.       <keyword>abstract</keyword>
  115.       <keyword>and</keyword>
  116.       <keyword>array</keyword>
  117.       <keyword>as</keyword>
  118.       <keyword>base</keyword>
  119.       <keyword>catch</keyword>
  120.       <keyword>class</keyword>
  121.       <keyword>def</keyword>
  122.       <keyword>do</keyword> 
  123.       <keyword>else</keyword>
  124.       <keyword>extends</keyword>
  125.       <keyword>extern</keyword>
  126.       <keyword>finally</keyword>
  127.       <keyword>foreach</keyword>
  128.       <keyword>for</keyword> 
  129.       <keyword>fun</keyword>
  130.       <keyword>if</keyword>
  131.       <keyword>implements</keyword>
  132.       <keyword>in</keyword>
  133.       <keyword>interface</keyword>
  134.       <keyword>internal</keyword>
  135.       <keyword>lock</keyword>
  136.       <keyword>macro</keyword>
  137.       <keyword>match</keyword>
  138.       <keyword>module</keyword>
  139.       <keyword>mutable</keyword>
  140.       <keyword>namespace</keyword>
  141.       <keyword>new</keyword>
  142.       <keyword>out</keyword>
  143.       <keyword>override</keyword>
  144.       <keyword>params</keyword>
  145.       <keyword>private</keyword>
  146.       <keyword>protected</keyword>
  147.       <keyword>public</keyword>
  148.       <keyword>ref</keyword>
  149.       <keyword>repeat</keyword>
  150.       <keyword>sealed</keyword>
  151.       <keyword>static</keyword>
  152.       <keyword>struct</keyword>
  153.       <keyword>syntax</keyword>
  154.       <keyword>this</keyword>
  155.       <keyword>throw</keyword>
  156.       <keyword>try</keyword>
  157.       <keyword>type</keyword>
  158.       <keyword>typeof</keyword>
  159.       <keyword>unless</keyword>
  160.       <keyword>until</keyword>
  161.       <keyword>using</keyword>
  162.       <keyword>variant</keyword>
  163.       <keyword>virtual</keyword>
  164.       <keyword>when</keyword>
  165.       <keyword>where</keyword>
  166.       <keyword>while</keyword>
  167.     </context>
  168.  
  169.     <context id="types" style-ref="type">
  170.       <keyword>bool</keyword>
  171.       <keyword>byte</keyword>
  172.       <keyword>char</keyword>
  173.       <keyword>decimal</keyword>
  174.       <keyword>double</keyword>
  175.       <keyword>float</keyword>
  176.       <keyword>int</keyword>
  177.       <keyword>list</keyword>
  178.       <keyword>long</keyword>
  179.       <keyword>object</keyword>
  180.       <keyword>sbyte</keyword>
  181.       <keyword>short</keyword>
  182.       <keyword>string</keyword>
  183.       <keyword>uint</keyword>
  184.       <keyword>ulong</keyword>
  185.       <keyword>ushort</keyword>
  186.       <keyword>void</keyword>
  187.     </context>
  188.  
  189.     <context id="null-value" style-ref="null-value">
  190.       <keyword>null</keyword>
  191.     </context>
  192.  
  193.     <context id="boolean" style-ref="boolean">
  194.       <keyword>false</keyword>
  195.       <keyword>true</keyword>
  196.     </context>
  197.  
  198.     <context id="float" style-ref="floating-point">
  199.       <match extended="true">
  200.         (?<![\w\.])
  201.         [0-9]*\.[0-9]+([eE][-+]?[0-9]+)?
  202.         (?![\w\.])
  203.       </match>
  204.     </context>
  205.  
  206.     <context id="decimal" style-ref="decimal">
  207.       <match extended="true">
  208.         (?<![\w\.])
  209.         [0-9]+[Uu]?([Ll]|[Ss]|[Bb])?
  210.         (?![\w\.])
  211.       </match>
  212.     </context>
  213.  
  214.     <context id="binary" style-ref="binary">
  215.       <match extended="true">
  216.         (?<![\w\.])
  217.         0[bB][01]+[Uu]?([Ll]|[Ss]|[Bb])?
  218.         (?![\w\.])
  219.       </match>
  220.     </context>
  221.  
  222.     <context id="octal" style-ref="octal">
  223.       <match extended="true">
  224.         (?<![\w\.])
  225.         0[oO][0-7]+[Uu]?([Ll]|[Ss]|[Bb])?
  226.         (?![\w\.])
  227.       </match>
  228.     </context>
  229.  
  230.     <context id="hexadecimal" style-ref="hexadecimal">
  231.       <match extended="true">
  232.         (?<![\w\.])
  233.         0[xX][0-9a-fA-F]+[Uu]?([Ll]|[Ss]|[Bb])?
  234.         (?![\w\.])
  235.       </match>
  236.     </context>
  237.  
  238.     <context id="nemerle">
  239.       <include>
  240.         <context ref="line-comment"/>
  241.         <context ref="block-comment"/>
  242.         <context ref="close-comment-outside-comment"/>
  243.         <context ref="if-false-comment"/>
  244.         <context ref="preprocessor"/>
  245.         <context ref="character"/>
  246.         <context ref="string"/>
  247.         <context ref="keywords"/>
  248.         <context ref="types"/>
  249.         <context ref="null-value"/>
  250.         <context ref="boolean"/>
  251.         <context ref="float"/>
  252.         <context ref="decimal"/>
  253.         <context ref="binary"/>
  254.         <context ref="octal"/>
  255.         <context ref="hexadecimal"/>
  256.       </include>
  257.     </context>
  258.  
  259.   </definitions>
  260.  
  261. </language>
  262.